import serverRequest from "@/utils/server-request.ts";

export function saveTestCaseService(problemId: string, testCase: string) {
    return serverRequest({
        url: '/case',
        method: 'POST',
        data: {
            problemId,
            testCase
        }
    })
}

export function updateTestCaseService(problemId: string, testCase: string) {
    return serverRequest({
        url: '/case',
        method: 'PUT',
        data: {
            problemId,
            testCase
        }
    })
}

export function getTestCaseService(problemId: string) {
    return serverRequest({
        url: '/case/' + problemId,
        method: 'GET'
    })
}

export function removeTestCaseService(problemId: string) {
    return serverRequest({
        url: '/case/' + problemId,
        method: 'DELETE'
    })
}